package com.gitee.feizns.webtemplate.entity.ao.commons.upload;

import com.gitee.feizns.webtemplate.commons.upload.MediaType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;

/**
 * 上传文件
 * @author feizns
 * @since 2019/5/16
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class FaUpload {

    /**
     * 是否异步
     */
    private boolean isAsync;

    /**
     * 上传的文件
     */
    @NotNull(message = "{file.notnull}")
    private MultipartFile file;

    /**
     * 上传资源类型
     */
    @NotNull(message = "{media.type.notnull}")
    private MediaType type;

}
